﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Web.Security;

namespace SocialCee.Authorization.Tests
{
    [TestClass]
    public class UserManager
    {

        [TestMethod]
        public void Create()
        {
            MembershipUser user = SocialCee.Authorization.UserManager.CreateUser("test2", "akhsdgfal$%#@SHlg12");
            Assert.IsNotNull(user);
            Assert.IsTrue(!string.IsNullOrEmpty(user.UserName));
            Assert.IsTrue(user.IsOnline);
        }

        [TestMethod]
        public void Create_WrongPassword()
        {
            MembershipUser user = SocialCee.Authorization.UserManager.CreateUser("test", "test");

            Assert.IsNull(user);
        }

        [TestMethod]
        public void Login()
        {
            bool logged = SocialCee.Authorization.UserManager.Login("test", "akhsdgfal$%#@SHlg12");

            Assert.IsTrue(logged);
        }
    }
}
